package org.cpoy.eims.entity;

// Generated Feb 24, 2011 8:45:00 AM by Hibernate Tools 3.3.0.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * Parent generated by hbm2java
 */
@Entity
@Table(name = "parent")
public class Parent implements java.io.Serializable {

	private int id;
	private UserAccount userAccount;
	private Student student;
	private Relationship relationship;
	private Address address;
	private String firstName;
	private String lastName;
	private int mobileNumber;
	private int officePhone;
	private String email;
	private Set<StudentAdmission> studentAdmissions = new HashSet<StudentAdmission>(
			0);
	private Set<StudentEmergencyContact> studentEmergencyContacts = new HashSet<StudentEmergencyContact>(
			0);

	public Parent() {
	}

	public Parent(int id, Student student, Address address, String firstName,
			String lastName, int mobileNumber, int officePhone) {
		this.id = id;
		this.student = student;
		this.address = address;
		this.firstName = firstName;
		this.lastName = lastName;
		this.mobileNumber = mobileNumber;
		this.officePhone = officePhone;
	}

	public Parent(int id, UserAccount userAccount, Student student,
			Relationship relationship, Address address, String firstName,
			String lastName, int mobileNumber, int officePhone, String email,
			Set<StudentAdmission> studentAdmissions,
			Set<StudentEmergencyContact> studentEmergencyContacts) {
		this.id = id;
		this.userAccount = userAccount;
		this.student = student;
		this.relationship = relationship;
		this.address = address;
		this.firstName = firstName;
		this.lastName = lastName;
		this.mobileNumber = mobileNumber;
		this.officePhone = officePhone;
		this.email = email;
		this.studentAdmissions = studentAdmissions;
		this.studentEmergencyContacts = studentEmergencyContacts;
	}

	@Id
	@Column(name = "id", unique = true, nullable = false)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id")
	public UserAccount getUserAccount() {
		return this.userAccount;
	}

	public void setUserAccount(UserAccount userAccount) {
		this.userAccount = userAccount;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "student_id", nullable = false)
	@NotNull
	public Student getStudent() {
		return this.student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "relationship_id")
	public Relationship getRelationship() {
		return this.relationship;
	}

	public void setRelationship(Relationship relationship) {
		this.relationship = relationship;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "address_id", nullable = false)
	@NotNull
	public Address getAddress() {
		return this.address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

	@Column(name = "first_name", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	@Column(name = "last_name", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getLastName() {
		return this.lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	@Column(name = "mobile_number", nullable = false)
	public int getMobileNumber() {
		return this.mobileNumber;
	}

	public void setMobileNumber(int mobileNumber) {
		this.mobileNumber = mobileNumber;
	}

	@Column(name = "office_phone", nullable = false)
	public int getOfficePhone() {
		return this.officePhone;
	}

	public void setOfficePhone(int officePhone) {
		this.officePhone = officePhone;
	}

	@Column(name = "email", length = 150)
	@Length(max = 150)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "parent")
	public Set<StudentAdmission> getStudentAdmissions() {
		return this.studentAdmissions;
	}

	public void setStudentAdmissions(Set<StudentAdmission> studentAdmissions) {
		this.studentAdmissions = studentAdmissions;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "parent")
	public Set<StudentEmergencyContact> getStudentEmergencyContacts() {
		return this.studentEmergencyContacts;
	}

	public void setStudentEmergencyContacts(
			Set<StudentEmergencyContact> studentEmergencyContacts) {
		this.studentEmergencyContacts = studentEmergencyContacts;
	}

}
